//
//  MutualViewController.m
//  dragDemo
//
//  Created by 吳瀾洲 on 2020/9/24.
//  Copyright © 2020 kingboyrang. All rights reserved.
//

#import "MutualViewController.h"
#import "GridView.h"

@interface MutualViewController ()
@property(nonatomic,strong) GridView *grid;
@end

@implementation MutualViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    PageModel *page = [[PageModel alloc] init];
     page.name = @"页面1";
     page.row = 5;
     page.column = 4;
     
     NSMutableArray *buttons = [NSMutableArray arrayWithCapacity:0];
     [buttons addObject:[ButtonModel createModelWithName:@"开机"]];
     [buttons addObject:[ButtonModel createModelWithName:@"关机"]];
     [buttons addObject:[ButtonModel createModelWithName:@"重启"]];
     
     [buttons addObject:[ButtonModel createModelWithName:@"复制"]];
     [buttons addObject:[ButtonModel createModelWithName:@"粘贴"]];
     [buttons addObject:[ButtonModel createModelWithName:@"剪切"]];
     [buttons addObject:[ButtonModel createModelWithName:@"快照"]];
     [buttons addObject:[ButtonModel createModelWithName:@"选择"]];
     [buttons addObject:[ButtonModel createModelWithName:@"全选"]];
     [buttons addObject:[ButtonModel createModelWithName:@"睡眠"]];
     [buttons addObject:[ButtonModel createModelWithName:@"待机"]];
     [buttons addObject:[ButtonModel createModelWithName:@"关于"]];
     [buttons addObject:[ButtonModel createModelWithName:@"唤醒"]];
     page.buttonList = buttons;
    
    CGRect r = self.view.frame;
    r.origin.y = 88.0f;
    r.size.height -= r.origin.y;
     self.grid = [[GridView alloc] initWithFrame:r];
     self.grid.pageModel = page;
     [self.grid createGrid];
     [self.view addSubview:self.grid];
    // Do any additional setup after loading the view.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
